#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main()
{
	double fval = 0;
	double left = -10.0, right = 10.0;
	double x = (left + right) / 2;
	double err = pow(10, -6);
	while (1)
	{
		x = (left + right) / 2;
		fval = 2 * pow(x, 3) - 4 * pow(x, 2) + 3 * x - 6;

		if (abs(fval) < err)
		{
			break;
		}

		if (fval > 0)
		{
			right = x;
		}
		else
		{
			left = x;
		}
	}
	printf("x = %lf\n", x);
	return 0;
}